3.1.10 \(\int (a-a \csc (c+d x)) (A+A \csc (c+d x)) \sin (c+d x) \, dx\) [10]

Optimal. Leaf size=27 \[ \frac {a A \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a A \cos (c+d x)}{d} \]

[Out]

a*A*arctanh(cos(d*x+c))/d-a*A*cos(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4047, 2672, 327, 212} \begin {gather*} \frac {a A \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a A \cos (c+d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a - a*Csc[c + d*x])*(A + A*Csc[c + d*x])*Sin[c + d*x],x]

[Out]

(a*A*ArcTanh[Cos[c + d*x]])/d - (a*A*Cos[c + d*x])/d

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2672

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, a*(Sin[e + f*x]/ff)
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 4047

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)
]*(d_.) + (c_))^(n_.), x_Symbol] :> Dist[((-a)*c)^m, Int[ExpandTrig[(g*csc[e + f*x])^p*cot[e + f*x]^(2*m), (c
+ d*csc[e + f*x])^(n - m), x], x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2
 - b^2, 0] && IntegersQ[m, n] && GeQ[n - m, 0] && GtQ[m*n, 0]

Rubi steps

\begin {align*} \int (a-a \csc (c+d x)) (A+A \csc (c+d x)) \sin (c+d x) \, dx &=-((a A) \int \cos (c+d x) \cot (c+d x) \, dx)\\ &=\frac {(a A) \text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {a A \cos (c+d x)}{d}+\frac {(a A) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=\frac {a A \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a A \cos (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 46, normalized size = 1.70 \begin {gather*} -a A \left (\frac {\cos (c+d x)}{d}-\frac {\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a - a*Csc[c + d*x])*(A + A*Csc[c + d*x])*Sin[c + d*x],x]

[Out]

-(a*A*(Cos[c + d*x]/d - Log[Cos[(c + d*x)/2]]/d + Log[Sin[(c + d*x)/2]]/d))

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 36, normalized size = 1.33

method result size
derivativedivides \(\frac {-A a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )-A a \cos \left (d x +c \right )}{d}\) \(36\)
default \(\frac {-A a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )-A a \cos \left (d x +c \right )}{d}\) \(36\)
norman \(\frac {2 A a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-\frac {A a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) \(52\)
risch \(-\frac {A a \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}-\frac {A a \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {A a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}-\frac {A a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}\) \(71\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a-a*csc(d*x+c))*(A+A*csc(d*x+c))*sin(d*x+c),x,method=_RETURNVERBOSE)

[Out]

1/d*(-A*a*ln(csc(d*x+c)-cot(d*x+c))-A*a*cos(d*x+c))

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 40, normalized size = 1.48 \begin {gather*} \frac {A a {\left (\log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 2 \, A a \cos \left (d x + c\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*csc(d*x+c))*(A+A*csc(d*x+c))*sin(d*x+c),x, algorithm="maxima")

[Out]

1/2*(A*a*(log(cos(d*x + c) + 1) - log(cos(d*x + c) - 1)) - 2*A*a*cos(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 2.94, size = 45, normalized size = 1.67 \begin {gather*} -\frac {2 \, A a \cos \left (d x + c\right ) - A a \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + A a \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*csc(d*x+c))*(A+A*csc(d*x+c))*sin(d*x+c),x, algorithm="fricas")

[Out]

-1/2*(2*A*a*cos(d*x + c) - A*a*log(1/2*cos(d*x + c) + 1/2) + A*a*log(-1/2*cos(d*x + c) + 1/2))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - A a \left (\int \sin {\left (c + d x \right )} \csc ^{2}{\left (c + d x \right )}\, dx + \int \left (- \sin {\left (c + d x \right )}\right )\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*csc(d*x+c))*(A+A*csc(d*x+c))*sin(d*x+c),x)

[Out]

-A*a*(Integral(sin(c + d*x)*csc(c + d*x)**2, x) + Integral(-sin(c + d*x), x))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 60 vs. \(2 (27) = 54\).
time = 0.42, size = 60, normalized size = 2.22 \begin {gather*} -\frac {A a \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right ) - \frac {4 \, A a}{\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*csc(d*x+c))*(A+A*csc(d*x+c))*sin(d*x+c),x, algorithm="giac")

[Out]

-1/2*(A*a*log(abs(-cos(d*x + c) + 1)/abs(cos(d*x + c) + 1)) - 4*A*a/((cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 1
))/d

________________________________________________________________________________________

Mupad [B]
time = 0.30, size = 40, normalized size = 1.48 \begin {gather*} -\frac {A\,a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {2\,A\,a}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(c + d*x)*(A + A/sin(c + d*x))*(a - a/sin(c + d*x)),x)

[Out]

- (A*a*log(tan(c/2 + (d*x)/2)))/d - (2*A*a)/(d*(tan(c/2 + (d*x)/2)^2 + 1))

________________________________________________________________________________________